接入友盟统计;升级至1010

chengzhenyu 8 年之前
父節點
當前提交
8a13183de8

+ 1 - 1
.idea/gradle.xml

@@ -5,7 +5,7 @@
5 5
       <GradleProjectSettings>
6 6
         <option name="distributionType" value="LOCAL" />
7 7
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
8
-        <option name="gradleHome" value="C:\Android\Studio\gradle\gradle-2.14.1" />
8
+        <option name="gradleHome" value="C:/Android/gradle-3.3" />
9 9
         <option name="modules">
10 10
           <set>
11 11
             <option value="$PROJECT_DIR$" />

+ 0 - 3
.idea/modules.xml

@@ -3,13 +3,10 @@
3 3
   <component name="ProjectModuleManager">
4 4
     <modules>
5 5
       <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
6
-      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
7
-      <module fileurl="file://$PROJECT_DIR$/common/common.iml" filepath="$PROJECT_DIR$/common/common.iml" />
8 6
       <module fileurl="file://$PROJECT_DIR$/common/common.iml" filepath="$PROJECT_DIR$/common/common.iml" />
9 7
       <module fileurl="file://$PROJECT_DIR$/lensman.iml" filepath="$PROJECT_DIR$/lensman.iml" />
10 8
       <module fileurl="file://$PROJECT_DIR$/lensman_ssh.iml" filepath="$PROJECT_DIR$/lensman_ssh.iml" />
11 9
       <module fileurl="file://$PROJECT_DIR$/views/views.iml" filepath="$PROJECT_DIR$/views/views.iml" />
12
-      <module fileurl="file://$PROJECT_DIR$/views/views.iml" filepath="$PROJECT_DIR$/views/views.iml" />
13 10
     </modules>
14 11
   </component>
15 12
 </project>

+ 16 - 3
app/build.gradle

@@ -3,7 +3,7 @@ apply plugin: 'android-apt'
3 3
 
4 4
 android {
5 5
     compileSdkVersion 24
6
-    buildToolsVersion "24.0.3"
6
+    buildToolsVersion "25.0.2"
7 7
 
8 8
     dexOptions {
9 9
         preDexLibraries false
@@ -20,10 +20,12 @@ android {
20 20
         applicationId "ai.pai.lensman"
21 21
         minSdkVersion 14
22 22
         targetSdkVersion 21
23
-        versionCode 1009
24
-        versionName "1.0.09"
23
+        versionCode 1010
24
+        versionName "1.0.10"
25 25
         buildConfigField "boolean", "isTestMode", "true"
26
+        manifestPlaceholders = [CHANNEL_NAME: "guanwang"]
26 27
     }
28
+
27 29
     signingConfigs {
28 30
         releaseConfig {
29 31
             storeFile file("paiai.keystore")
@@ -33,6 +35,16 @@ android {
33 35
         }
34 36
     }
35 37
 
38
+    productFlavors.all {
39
+        flavor->flavor.manifestPlaceholders=[CHANNEL_NAME:name]
40
+    }
41
+
42
+    productFlavors {
43
+        guanwang {
44
+
45
+        }
46
+    }
47
+
36 48
     buildTypes {
37 49
         release {
38 50
             minifyEnabled true
@@ -72,4 +84,5 @@ dependencies {
72 84
     compile files('libs/commons-lang-2.6.jar')
73 85
     compile files('libs/gprintersdkv2.1.4.jar')
74 86
     compile files('libs/jcc-bate-0.7.3.jar')
87
+    compile 'com.umeng.analytics:analytics:latest.integration'
75 88
 }

+ 9 - 0
app/src/main/AndroidManifest.xml

@@ -27,6 +27,15 @@
27 27
         android:largeHeap="true"
28 28
         android:theme="@style/AppTheme.NoActionBar">
29 29
 
30
+
31
+        <meta-data
32
+            android:name="UMENG_CHANNEL"
33
+            android:value="${CHANNEL_NAME}" />
34
+
35
+        <meta-data
36
+            android:name="UMENG_APPKEY"
37
+            android:value="58bbdceda3251102a9000251"></meta-data>
38
+
30 39
         <activity
31 40
             android:name=".splash.SplashActivity"
32 41
             android:configChanges="keyboardHidden|orientation|screenSize"

+ 6 - 0
app/src/main/java/ai/pai/lensman/activities/AboutUsActivity.java

@@ -23,6 +23,12 @@ public class AboutUsActivity extends BaseActivity implements View.OnClickListene
23 23
         SystemUtils.setImmerseLayout(this,findViewById(R.id.title_layout));
24 24
         TextView title = (TextView)findViewById(R.id.title_bar_middle_txt);
25 25
         title.setText(R.string.about_us);
26
+        TextView curVersionText = (TextView)findViewById(R.id.tv_cur_version);
27
+        try {
28
+            curVersionText.setText( "v"+getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
29
+        }catch (Exception e){
30
+            e.printStackTrace();
31
+        }
26 32
         findViewById(R.id.title_bar_back_layout).setOnClickListener(this);
27 33
         findViewById(R.id.title_bar_option_layout).setVisibility(View.INVISIBLE);
28 34
         findViewById(R.id.layout_about_declare).setOnClickListener(this);

+ 13 - 0
app/src/main/java/ai/pai/lensman/base/BaseActivity.java

@@ -10,6 +10,7 @@ import com.android.views.swipebacklayout.SwipeBackActivityBase;
10 10
 import com.android.views.swipebacklayout.SwipeBackActivityHelper;
11 11
 import com.android.views.swipebacklayout.SwipeBackLayout;
12 12
 import com.android.views.swipebacklayout.Utils;
13
+import com.umeng.analytics.MobclickAgent;
13 14
 
14 15
 import ai.pai.lensman.R;
15 16
 import butterknife.Unbinder;
@@ -43,6 +44,18 @@ public class BaseActivity extends AppCompatActivity implements SwipeBackActivity
43 44
     }
44 45
 
45 46
     @Override
47
+    protected void onResume() {
48
+        super.onResume();
49
+        MobclickAgent.onResume(this);
50
+    }
51
+
52
+    @Override
53
+    protected void onPause() {
54
+        super.onPause();
55
+        MobclickAgent.onPause(this);
56
+    }
57
+
58
+    @Override
46 59
     protected void onDestroy() {
47 60
         super.onDestroy();
48 61
         if(unbinder!=null){

+ 4 - 0
app/src/main/java/ai/pai/lensman/briefs/BriefsActivity.java

@@ -11,11 +11,14 @@ import android.widget.TextSwitcher;
11 11
 import android.widget.TextView;
12 12
 import android.widget.ViewSwitcher;
13 13
 
14
+import com.umeng.analytics.MobclickAgent;
15
+
14 16
 import ai.pai.lensman.R;
15 17
 import ai.pai.lensman.activities.WebViewActivity;
16 18
 import ai.pai.lensman.base.BaseActivity;
17 19
 import ai.pai.lensman.bean.BriefsBean;
18 20
 import ai.pai.lensman.settings.SettingsActivity;
21
+import ai.pai.lensman.utils.UmengEvent;
19 22
 import ai.pai.lensman.utils.UrlContainer;
20 23
 import butterknife.BindView;
21 24
 import butterknife.ButterKnife;
@@ -73,6 +76,7 @@ public class BriefsActivity extends BaseActivity implements BriefsContract.View{
73 76
 
74 77
     @OnClick(R.id.iv_settings)
75 78
     void goToSettingPage(){
79
+        MobclickAgent.onEvent(this, UmengEvent.brief_setting_btn_click);
76 80
         startActivity(new Intent(this, SettingsActivity.class));
77 81
     }
78 82
 

+ 4 - 0
app/src/main/java/ai/pai/lensman/main/MainActivity.java

@@ -11,6 +11,7 @@ import android.widget.TextView;
11 11
 import android.widget.Toast;
12 12
 
13 13
 import com.android.common.utils.LogHelper;
14
+import com.umeng.analytics.MobclickAgent;
14 15
 
15 16
 import java.util.ArrayList;
16 17
 
@@ -19,6 +20,7 @@ import ai.pai.lensman.base.BaseActivity;
19 20
 import ai.pai.lensman.bean.SessionBean;
20 21
 import ai.pai.lensman.briefs.BriefsActivity;
21 22
 import ai.pai.lensman.session.SessionActivity;
23
+import ai.pai.lensman.utils.UmengEvent;
22 24
 import butterknife.BindView;
23 25
 import butterknife.ButterKnife;
24 26
 import butterknife.OnClick;
@@ -64,12 +66,14 @@ public class MainActivity extends BaseActivity implements MainContract.View {
64 66
 
65 67
     @OnClick(R.id.iv_briefs)
66 68
     void jumpToBriefs(){
69
+        MobclickAgent.onEvent(this, UmengEvent.home_brief_btn_click);
67 70
         startActivity(new Intent(this, BriefsActivity.class));
68 71
     }
69 72
 
70 73
     @OnClick(R.id.iv_add_session)
71 74
     void jumpToNewSession(){
72 75
         LogHelper.d(TAG,"jumpToNewSession");
76
+        MobclickAgent.onEvent(this, UmengEvent.home_add_session_btn_click);
73 77
         jumpToSelectedSession( presenter.createNewSession());
74 78
     }
75 79
 

+ 6 - 0
app/src/main/java/ai/pai/lensman/session/SessionActivity.java

@@ -15,6 +15,7 @@ import android.widget.Toast;
15 15
 
16 16
 import com.android.common.utils.LogHelper;
17 17
 import com.android.common.utils.NetworkUtil;
18
+import com.umeng.analytics.MobclickAgent;
18 19
 
19 20
 import java.io.File;
20 21
 
@@ -25,6 +26,7 @@ import ai.pai.lensman.bean.PhotoBean;
25 26
 import ai.pai.lensman.bean.SessionBean;
26 27
 import ai.pai.lensman.printer.PrinterSettingActivity;
27 28
 import ai.pai.lensman.qrcode.QRCaptureActivity;
29
+import ai.pai.lensman.utils.UmengEvent;
28 30
 import butterknife.BindView;
29 31
 import butterknife.ButterKnife;
30 32
 import butterknife.OnClick;
@@ -111,12 +113,15 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie
111 113
 
112 114
     @OnClick(R.id.iv_scan)
113 115
     void scanToFetchSessionQR(){
116
+        MobclickAgent.onEvent(this, UmengEvent.session_scan_qr_btn_click);
114 117
         Intent intent = new Intent(SessionActivity.this, QRCaptureActivity.class);
115 118
         startActivityForResult(intent, JOIN_REQUEST_CODE);
119
+
116 120
     }
117 121
 
118 122
     @OnClick(R.id.iv_qrcode)
119 123
     void showQRCodeForSession(){
124
+        MobclickAgent.onEvent(this, UmengEvent.session_view_qr_btn_click);
120 125
         Intent intent = new Intent(this,SessionQRCodeActivity.class);
121 126
         intent.putExtra("qrcode",sessionBean.sessionId);
122 127
         startActivity(intent);
@@ -130,6 +135,7 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie
130 135
 
131 136
     @OnClick(R.id.btn_session_complete)
132 137
     void onSessionComplete(){
138
+        MobclickAgent.onEvent(this, UmengEvent.session_finish_btn_click);
133 139
         presenter.stop();
134 140
         finish();
135 141
     }

+ 14 - 0
app/src/main/java/ai/pai/lensman/utils/UmengEvent.java

@@ -0,0 +1,14 @@
1
+package ai.pai.lensman.utils;
2
+
3
+/**
4
+ * Created by chengzhenyu on 2017/3/5.
5
+ */
6
+
7
+public class UmengEvent {
8
+    public static final String home_add_session_btn_click = "home_add_session_btn_click";
9
+    public static final String home_brief_btn_click ="home_brief_btn_click";
10
+    public static final String session_finish_btn_click = "session_finish_btn_click";
11
+    public static final String brief_setting_btn_click ="brief_setting_btn_click";
12
+    public static final String session_scan_qr_btn_click = "session_scan_qr_btn_click";
13
+    public static final String session_view_qr_btn_click ="session_view_qr_btn_click";
14
+}

+ 10 - 0
app/src/main/res/layout/activity_about_us.xml

@@ -49,6 +49,16 @@
49 49
             android:textColor="@color/dark_grey"
50 50
             android:layout_marginLeft="10dp"/>
51 51
 
52
+        <TextView
53
+            android:id="@+id/tv_cur_version"
54
+            android:layout_width="0dp"
55
+            android:layout_weight="1"
56
+            android:layout_height="wrap_content"
57
+            android:textSize="14sp"
58
+            android:gravity="right"
59
+            android:textColor="@color/grey"
60
+            android:layout_marginRight="10dp"/>
61
+
52 62
         <ImageView
53 63
             android:layout_width="wrap_content"
54 64
             android:layout_height="wrap_content"

+ 1 - 1
build.gradle

@@ -5,7 +5,7 @@ buildscript {
5 5
         jcenter()
6 6
     }
7 7
     dependencies {
8
-        classpath 'com.android.tools.build:gradle:2.2.3'
8
+        classpath 'com.android.tools.build:gradle:2.3.0'
9 9
         classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
10 10
         // NOTE: Do not place your application dependencies here; they belong
11 11
         // in the individual module build.gradle files

+ 2 - 2
common/build.gradle

@@ -2,11 +2,11 @@ apply plugin: 'com.android.library'
2 2
 
3 3
 android {
4 4
     compileSdkVersion 24
5
-    buildToolsVersion "24.0.3"
5
+    buildToolsVersion "25.0.2"
6 6
 
7 7
     defaultConfig {
8 8
         minSdkVersion 14
9
-        targetSdkVersion 23
9
+        targetSdkVersion 21
10 10
         versionCode 1
11 11
         versionName "1.0"
12 12
     }

+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
1
-#Thu Aug 18 08:08:09 CST 2016
1
+#Sun Mar 05 10:19:46 CST 2017
2 2
 distributionBase=GRADLE_USER_HOME
3 3
 distributionPath=wrapper/dists
4 4
 zipStoreBase=GRADLE_USER_HOME
5 5
 zipStorePath=wrapper/dists
6
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

+ 2 - 2
views/build.gradle

@@ -2,11 +2,11 @@ apply plugin: 'com.android.library'
2 2
 
3 3
 android {
4 4
     compileSdkVersion 24
5
-    buildToolsVersion "24.0.3"
5
+    buildToolsVersion "25.0.2"
6 6
 
7 7
     defaultConfig {
8 8
         minSdkVersion 14
9
-        targetSdkVersion 23
9
+        targetSdkVersion 21
10 10
         versionCode 1
11 11
         versionName "1.0"
12 12
     }